﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PokerManage
{
    public partial class Form1 : Form
    {
        PictureBox[] pictureBoxes;
        Deck deck = new Deck();
        public Form1()
        {
            InitializeComponent();
            pictureBoxes = new PictureBox[]
            {
                pictureBox1,
                pictureBox2,
                pictureBox3,
                pictureBox4,
                pictureBox5,
                pictureBox6,
                pictureBox7,
                pictureBox8,
                pictureBox9,
                pictureBox10,
                pictureBox11,
                pictureBox12,
                pictureBox13,
                pictureBox14,
                pictureBox15,
                pictureBox16,
                pictureBox17,
                pictureBox18,
                pictureBox19,
                pictureBox20,
                pictureBox21,
                pictureBox22,
                pictureBox23,
                pictureBox24,
                pictureBox25,
                pictureBox26,
                pictureBox27,
                pictureBox28,
                pictureBox29,
                pictureBox30,
                pictureBox31,
                pictureBox32,
                pictureBox33,
                pictureBox34,
                pictureBox35,
                pictureBox36,
                pictureBox37,
                pictureBox38,
                pictureBox39,
                pictureBox40,
                pictureBox41,
                pictureBox42,
                pictureBox43,
                pictureBox44,
                pictureBox45,
                pictureBox46,
                pictureBox47,
                pictureBox48,
                pictureBox49,
                pictureBox50,
                pictureBox52,
                pictureBox51,
            }; 
        }

        private void button1_Click(object sender, EventArgs e)
        {
            deck.Refresh();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < pictureBoxes.Length; i++)
            {
                pictureBoxes[i].Image = Image.FromFile(deck.Cards[i].Image);
            }                                         
        }
    }
}
